const NodeCache = require("node-cache");
module.exports = () => {
    myCache = new NodeCache({ checkperiod: 1800 });
    global.cache = myCache;//绑定到nodejs 全局
    return async (ctx, next) => {
        ctx.cache = myCache;//绑定到 koa 上下文
        await next();
    }
}